/*


 */
function getAge(sfzh){
    // 提取出生日期，18 位身份证号码中出生日期位于第 6 到 14 位
    let birthDateStr = sfzh.substring(6, 14);
    // 将出生日期字符串转换为日期对象
    let birthDate = new Date(birthDateStr.substring(0, 4), parseInt(birthDateStr.substring(4, 6)) - 1, birthDateStr.substring(6, 8));
    // 获取当前日期
    let currentDate = new Date();
    // 计算年龄
    let age = currentDate.getFullYear() - birthDate.getFullYear();
    // 检查是否已经过了生日
    if (currentDate.getMonth() < birthDate.getMonth() || (currentDate.getMonth() === birthDate.getMonth() && currentDate.getDate() < birthDate.getDate())) {
        age--;
    }
    return age;
}


function encodePwd(str,key)
{
    result="";
    for( i=0;i<str.length;i++)
    {
        if(str[i]>='A'&&str[i]<='Z')
        {
            key1=key%26;
            index=(str.charCodeAt(i)-65+26+key1)%26;
            result=result+String.fromCharCode(index+65)
        }
        else if(str[i]>='a'&&str[i]<='z')
        {
            key1=key%26;
            index=(str.charCodeAt(i)-97+26+key1)%26;
            result=result+String.fromCharCode(index+97)
        }
        else if(str[i]>='0'&&str[i]<='9')
        {
            key1=key%10;
            index=(str.charCodeAt(i)-48+10+key1)%10;
            result=result+String.fromCharCode(index+48)
        }
        else result=result+str[i]
    }
    return result
}
